package cn.cqnu.controller.front;

import cn.cqnu.domin.dto.FrontMatchDto;
import cn.cqnu.domin.vo.MatchListVo;
import cn.cqnu.domin.vo.ResponseResult;
import cn.cqnu.domin.vo.frontMatchListVo;
import cn.cqnu.service.MatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @作者：张世豪
 * @version：1.0
 */
@RestController
@RequestMapping("/front/match")
public class FrontMatchController {
    @Autowired
    MatchService matchService;

    @PostMapping("/matchList")
    public ResponseResult matchList(@RequestBody FrontMatchDto frontMatchDto) {
        List<frontMatchListVo> result = matchService.frontMatchList(frontMatchDto);
        return ResponseResult.ok(result);
    }

    @GetMapping("/getMatchByID/{id}")
    public ResponseResult getMatchById(@PathVariable String id){
        MatchListVo result = matchService.getMatchById(id);
        return ResponseResult.ok(result);
    }
}
